package com.service.impl;

import com.dao.UserDao;
import com.pojo.User;
import com.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Resource
    private UserDao userDao;

    @Override
    public List<User> getUserAll() {


        return userDao.getUser();
    }

    @Override
    public User getUser(int id) {
        return userDao.selectOne(id);
    }

    @Override
    public int addUser(User user) {
        return userDao.add(user);
    }
}
